package com.unism.util;

public enum PumpType {
	/**
	 * 1:河水加压主泵
	 * 2:河水加压备泵
	 * 3:河水自压
	 * 4:地下水
	 */
	/**
	 * 1: 工业用水
	 * 2: 农业用水
	 */
	/**
	* 	1:管灌
	*	2:膜下滴灌
	*	3:滴灌
	*	4:喷灌
	*	5:其他
	 */
	AGRICULTURE_TYPE("农业用水",0),INDUSTRY_TYPE("工业用水",1),
	PIPE_IRRIGATION("管灌",2),MEMBRANE_IRRIGATION("膜下滴灌",3),DROP_IRRIGATION("滴灌",4),SPRAY_IRRIGATION("喷灌",5),OTHER("其他",6),
	RIVER_MAIN_PIPE("河水加压主泵",7),RIVER_ALTERNATE_PIPE("河水加压备泵",8),RIVER_SELF_PIPE("河水自压",9),GROUND_WATER("地下水",10),;
	private String name;
	private Integer index;
	private PumpType(String name, Integer index) {
		this.name = name;
		this.index = index;
	}
	public static Integer getIndex(String name) {
		PumpType[] types = PumpType.values();
		for (PumpType pumpType : types) {
			if (name.equals(pumpType.getName())) {
				return pumpType.getIndex();
			}
		}
		return null;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getIndex() {
		return index;
	}
	public void setIndex(Integer index) {
		this.index = index;
	}
}
